package thread.java20221201;

/**
 * 通过实现Runnable接口, 创建线程
 */
class MyRunnable implements Runnable{
    @Override
    public void run() {
        System.out.println("my runnable");
    }
}
public class Demo3 {
    public static void main(String[] args) {
        MyRunnable runnable = new MyRunnable();
        Thread thread = new Thread(runnable);
        thread.start();
    }
}
